﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using MillerApp.CommonLib.Utility;
using System.Threading;


namespace MillerApp.Service
{
    public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            this.appTimer.Enabled = true;
            CommonHelper helper = new CommonHelper();
            double timerInterval = 300000;
            try
            {
                string timerIntervalConfig = helper.GetAppSettingConfig("TimerInterval");
                if (string.IsNullOrEmpty(timerIntervalConfig) == false)
                {
                    timerInterval = System.Convert.ToDouble(timerIntervalConfig);
                }
            }
            catch { }
            this.appTimer.Interval = timerInterval;
        }

        protected override void OnStop()
        {
            this.appTimer.Enabled = false;
        }

        private void appTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            try
            {
                
            }
            catch(Exception ex)
            {

            }
        }
    }
}
